package fast.loader;
import java.util.HashMap;

import fast.data.Stat;
import fast.mvc.View;

public class EnchantDB {
	
	HashMap<Integer,Enchant> db = new HashMap<Integer,Enchant>();
	
	public EnchantDB(){
		populateEnchantDB();
	}
	
	private void populateEnchantDB() {
		db.put(4076, new Enchant("35agi", "feet", Stat.agi, 35));	// feet 35agi
		db.put(4094, new Enchant("50mastery", "feet", Stat.mst, 50));	// feet 50mastery
		db.put(4105, new Enchant("25agi/runspeed", "feet", Stat.agi, 25));	// feet 25agi/runspeed
		db.put(1099, new Enchant("22agi", "back", Stat.agi, 22));	// back 22agi
		db.put(4100, new Enchant("65crit", "back", Stat.cri, 65));	// back 65crit
		db.put(4102, new Enchant("20stats", "chest", Stat.str, 20,Stat.agi, 20));	// chest 20stats
		Enchant wrist130agi = new Enchant("130agi", "wrist", Stat.agi, 130);
		wrist130agi.setLeatherworkerOnly(true);
		db.put(4190, wrist130agi); // wrist 130agi
		db.put(4258, new Enchant("50agi", "wrist", Stat.agi, 50)); // wrist 50agi
		Enchant ring40agi = new Enchant("40agi", "finger", Stat.agi, 40);
		ring40agi.setEnchanterOnly(true);
		db.put(4079, ring40agi); // ring 40agi
		db.put(4082, new Enchant("50exp", "hands", Stat.exp, 50)); // hands 50exp
		db.put(4068, new Enchant("50haste", "hands", Stat.hst, 50)); // hands 50haste
		db.put(4107, new Enchant("65mastery", "hands", Stat.mst, 65)); // hands 65mastery
		db.put(4204, new Enchant("50agi/25mastery", "shoulder", Stat.agi, 50, Stat.mst, 25)); // shoulder 50agi/25mastery
		Enchant shoulder130agi25mastery = new Enchant("130agi/25mastery", "shoulder", Stat.agi, 130, Stat.mst, 25);
		shoulder130agi25mastery.setInscripterOnly(true);
		db.put(4193, shoulder130agi25mastery); // shoulder 130agi/25mastery
		db.put(4126, new Enchant("190ap/55crit", "legs", Stat.ap, 190,Stat.cri, 55)); // legs 190ap/55crit (leatherworker only)
		db.put(4440, new Enchant("190ap/55crit", "legs", Stat.ap, 190,Stat.cri, 55)); // legs 190ap/55crit 
		
		db.put(4064, new Enchant("56pvppower", "back", Stat.pvppower, 56)); // 56 pvp power
		
		db.put(4064, new Enchant("weapon_chain","weapon", Stat.hit, 40)); // weapon 40 hit
		db.put(4083, new Enchant("hurricane","weapon"));
		db.put(4099, new Enchant("landslide","weapon"));
		
		Enchant leg95agi55crit = new Enchant("Primal Leg Reinforcements", "legs", Stat.agi, 95, Stat.cri, 55);
		leg95agi55crit.setLeatherworkerOnly(true);
		db.put(4883, leg95agi55crit); // legs 95agi/55crit
		
		// mop LEVEL_90
		db.put(4441, new Enchant("windsong","weapon")); // real ppm
		db.put(4444, new Enchant("dancing_steel","weapon"));
		db.put(4443, new Enchant("elemental_force","weapon"));
		db.put(4918, new Enchant("living_steel_weapon_chain","weapon", Stat.exp, 200)); // weapon 200 exp
		Enchant ring160agi = new Enchant("Greater Agility", "finger", Stat.agi, 160);
		ring160agi.setEnchanterOnly(true);
		db.put(4359, ring160agi); // ring 160agi
		Enchant wrist500agi = new Enchant("Fur Lining - Agility", "wrist", Stat.agi, 500);
		wrist500agi.setLeatherworkerOnly(true);
		db.put(4875, wrist500agi); // wrist 500agi
		db.put(4416, new Enchant("Greater Agility", "wrist", Stat.agi, 180)); // wrist 170agi
		db.put(4411, new Enchant("Mastery", "wrist", Stat.mst, 170)); // wrist 170mastery
		db.put(4429, new Enchant("Pandaren's Step", "feet", Stat.mst, 140)); // boots 140mastery
		db.put(4428, new Enchant("Blurred Speed", "feet", Stat.agi, 140)); // boots 140agi
		db.put(4426, new Enchant("Greater Haste", "feet", Stat.hst, 175)); // boots 175haste
		db.put(4427, new Enchant("Greater Precision", "feet", Stat.hit, 175)); // boots 175hit
		db.put(4419, new Enchant("Glorious Stats", "chest", Stat.str, 80, Stat.agi, 80)); // chest 80stats
		db.put(4430, new Enchant("Greater Haste", "hands", Stat.hst, 170)); // hands 170haste
		db.put(4433, new Enchant("Superior Mastery", "hands", Stat.mst, 170)); // hands 170mastery
		db.put(4431, new Enchant("Superior Expertise", "hands", Stat.exp, 170)); // hands 170exp
		db.put(4432, new Enchant("Super Strength", "hands", Stat.str, 170)); // hands 170str
		db.put(4421, new Enchant("Accuracy", "back", Stat.hit, 180)); // back 180hit
		db.put(4424, new Enchant("Crit", "back", Stat.cri, 180)); // back 180crit
		
		Enchant leg285agi165crit = new Enchant("Primal Leg Reinforcements", "legs", Stat.agi, 285, Stat.cri, 165);
		leg285agi165crit.setLeatherworkerOnly(true);
		db.put(4880, leg285agi165crit); // legs 285agi/165
		
		db.put(4822, new Enchant("Shadowleather Leg Armor", "legs", Stat.agi, 285, Stat.cri, 165)); // legs 285agi/165
		db.put(4871, new Enchant("Sha-Touched Leg Armor", "legs", Stat.agi, 170, Stat.cri, 100)); // legs 170agi/100crit
		db.put(4908, new Enchant("Tiger Claw Inscription", "shoulder", Stat.agi, 120, Stat.cri, 80)); // shoulder 120agi/80crit
		db.put(4804, new Enchant("Greater Tiger Claw Inscription", "shoulder", Stat.agi, 200, Stat.cri, 100)); // shoulder 200agi/100crit
		Enchant shoulder520agi100crit =  new Enchant("Secret Tiger Claw Inscription", "shoulder", Stat.agi, 520, Stat.cri, 100);
		shoulder520agi100crit.setInscripterOnly(true);
		db.put(4914, shoulder520agi100crit); // shoulder520agi100crit
		
		Enchant backTailor = new Enchant("swordguard_embroidery", "back");
		backTailor.setTailorOnly(true);
		db.put(4894, backTailor);
	}
	
	public HashMap<Integer,Enchant> getDB(){
		return db;
	}
	
	public Enchant getEnchant(int id){
		if(db.containsKey(id)){
			return db.get(id);
		}
		View.showError("unknown enchantid: "+  id);
		return null;
	}
}
